package com.doodod.common.utils;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import java.util.ResourceBundle;

/**
 * Created with IntelliJ IDEA.
 * User: 邱孝兵
 * Date: 2014/8/19
 * Time: 19:59
 */
public class InitListener implements ServletContextListener {
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        ServletContext context = servletContextEvent.getServletContext();
        ResourceBundle resourceBundle = ResourceBundle.getBundle("global");
        String address = resourceBundle.getString("assets_address");
        context.setAttribute("assets_address", address);
    }

    @Override
    public void contextDestroyed(ServletContextEvent servletContextEvent) {

    }
}
